import request from '@/utils/request'

const getCulturalProductList = (page, limit, key) => {
  return request('/culturalproduct/listWeb', {
    method: 'get',
    params: {
      page,
      limit,
      key
    }
  })
}

const getCulturalProductListByFuzzyQuery = (page, limit, key) => {
  return request('/culturalproduct/listByFuzzyQuery', {
    method: 'get',
    params: {
      page,
      limit,
      key
    }
  })
}

const deleteCulturalProductList = (culturalProductNos) => {
  return request('/culturalproduct/delete', {
    method: 'post',
    data: {
      culturalProductNos
    }
  })
}

const getCulturalProductById = (culturalproductId) => {
  return request({
    url: `/culturalproduct/info/${culturalproductId}`,
    method: 'get'
  })
}

const saveOrUpdateCulturalProduct = (culturalproductId, culturalproduct) => {
  return request(`/culturalproduct/${!culturalproductId ? 'save' : 'update'}`, {
    method: 'post',
    data: culturalproduct
  })
}

export { getCulturalProductList, getCulturalProductListByFuzzyQuery, deleteCulturalProductList, getCulturalProductById, saveOrUpdateCulturalProduct }
